package com.originskyseed.platform.user.mapper;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.originskyseed.platform.user.model.PlayerRelateConsume;

/**
 * 玩家消费信息表Mapper类（OSI_PLAYER_RELATE_CONSUME）
 *
 * @author wlj
 */
public interface PlayerRelateConsumeMapper {

	/**
	 * 删除记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKey(String id) throws Exception;

	/**
	 * 批量删除记录
	 *
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKeys(List<String> ids) throws Exception;

	/**
	 * 插入记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insert(PlayerRelateConsume record) throws Exception;

	/**
	 * 插入记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insertSelective(PlayerRelateConsume record) throws Exception;

	/**
	 * 更新记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKey(PlayerRelateConsume record) throws Exception;

	/**
	 * 更新记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKeySelective(PlayerRelateConsume record) throws Exception;


	/**
	 * 更新记录（仅非空值字段）
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public int updateByPlayerIdAndChannelTime(Map<String, Object> params) throws Exception;

	/**
	 * 查询记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public PlayerRelateConsume selectByPrimaryKey(String id) throws Exception;

	/**
	 * 查询玩家对主播的消费记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public BigDecimal countAmountByIdAndAnchorId(@Param("id") String id, @Param("anchorId") String anchorId) throws Exception;

	/**
	 * 查询列表
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public List<PlayerRelateConsume> selectList(PlayerRelateConsume record) throws Exception;

	/**
	 * 分页查询列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<PlayerRelateConsume> selectListByPage(Map<String, Object> params) throws Exception;

	/**
	 * 批量插入
	 *
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public int insertBatch(List<PlayerRelateConsume> list) throws Exception;

	/**
	 * 批量插入记录,月表
	 *
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public int insertMonthBatch(List<PlayerRelateConsume> list) throws Exception;

	/**
	 * 分页查询消费明细列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<PlayerRelateConsume> selectConsumptionDetailsByPage(Map<String, Object> params) throws Exception;

	/**
	 * 查询消费明细列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<PlayerRelateConsume> selectConsumptionDetailsByMap(Map<String, Object> params) throws Exception;

	/**
	 * 查询orderId是否存在
	 * 
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public List<String> selectOrderIds(List<String> list) throws Exception;

	/**
	 * 查询消费总额
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public BigDecimal selectTotalAmountByMap(Map<String, Object> params) throws Exception;

	/**
	 * 更新记录,根据子渠道id和分隔时间
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public int updateByChannelSubId(Map<String, Object> params) throws Exception;



	/**
	 * 分组统计玩家消费金额
	 *
	 * @param anchorId
	 * @return
	 * @throws Exception
	 */
	public List<Map<String,Object>> selectPlayerAmount(@Param("anchorId") String anchorId) throws Exception;


	/**
	 * 查询玩家充值的数量
	 * @param anchorId
	 * @return
	 * @throws Exception
	 */
	public Integer selectPlayerNumByAnchorId(@Param("anchorId") String anchorId) throws Exception;
}
